package cbr.resilienceManager.qmul.gemom;

import resilienceManager.qmul.gemom.Gbroker;


/**
 * The data structure for case based reasoning 
 * COPYRIGHT DISCLAIMER
 * Synopsis: All the source codes presented in this document are intellectual
 * properties of Queen Mary, University of London.
 * 
 * @year 2010
 * @author Peng Jiang, John Bigham, Jiayi Wu Jinfu Wang------------QMUL
 * @version 1.0 
 */

public class CbrData {
	 

	// The 
	private int gbN=4;
	
	// the state table information
	private float[] state;
	
	// the solution table information
	private String[] solution;
	
	// the table ID, means which gbroker(ID) is broken
	private int tableID;
	
	
	// the new Data or not
	public boolean Nsate;
	
	// the risk 
	private float riskValue;
	
	// the constructor
	public CbrData(int tid){
		
		state = new float[gbN];
		
		solution = new String[gbN];
		
		tableID=tid;
	}
	
	public CbrData(int tid, boolean ini){
		
		tableID=tid;
		
		gbN=0;
			
	}

	

	public CbrData(Gbroker[] glist, int tid){
		
		state = new float[gbN];
		
		solution = new String[gbN];
		
		tableID = tid;
		
		for(int i=0; i< gbN; i++){
			
			state[i]=(float) glist[i].getState();
		}
		
	}
	
	
	public float[] getState(){
		
		return state;
	}
	
	public String[] getSoultion(){
		
		return solution;
	}
	
	public void setSate(float[] s){
		state=s;
	}
	
	public void setSoultion(String[] s){
		solution=s;
	}
	
	public int getTableID()
	{
		return tableID;
	}
	
	public float getRisk(){
		
		return riskValue;
	}
	
	public void setRisk(float risk){
		
		riskValue=risk;
	}

	
	

}
